package controller.web;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.ibatis.annotations.Param;
import org.springframework.http.HttpCookie;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import pojo.Account;

import java.util.List;
import java.util.Map;

@CrossOrigin
@Controller
@RequestMapping("/test")
@ResponseBody
public class testWeb {
    @RequestMapping ("/show")
    public Object show(){

        System.out.println("hello");
        return JSON.toJSON("ok");
    }
    @RequestMapping("setCookies")
    public Object setCookies(HttpServletResponse response){
        for(int x=0;x<100;x++){
            response.addCookie(new Cookie("test"+x,"wang"+x));
        }
        return "ok";
    }


}
